<style>
  .text {
    font-size: 14px;
  }

  .item {
    margin-bottom: 18px;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }

  .box-card {
    width: 480px;
  }
  .box {
    width: 400px;
  }

  .top {
    text-align: center;
  }

  .left {
    float: left;
    width: 500px;
  }

  .right {
    float: right;
    width: 60px;
  }

  .bottom {
    clear: both;
    text-align: center;
  }

  .item {
    margin: 4px;
  }

  .left .el-tooltip__popper,
  .right .el-tooltip__popper {
    padding: 8px 10px;
  }
</style>
<template>
  <div class="app-container">
    <div class="left">
      <el-tooltip class="item" effect="dark" content="Left Top 提示文字" placement="left-start">
        <el-card class="box-card">
          <div v-for="o in 4" :key="o" class="text item">
            aa
          </div>
        </el-card>
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="Left Center 提示文字" placement="left">
        <el-card class="box-card">
          <div v-for="o in 4" :key="o" class="text item">
            bb
          </div>
        </el-card>
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="Left Bottom 提示文字" placement="left-end">
        <el-card class="box-card">
          <div v-for="o in 4" :key="o" class="text item">
            b
          </div>
        </el-card>
      </el-tooltip>
    </div>
    <div class="bottom">
      <el-tooltip class="item" effect="dark" content="Bottom Left 提示文字" placement="bottom-start">
        <el-button>商家管理</el-button>
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="Bottom Center 提示文字" placement="bottom">
        <el-button>提现管理</el-button>
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="Bottom Right 提示文字" placement="bottom-end">
        <el-button>钱包管理</el-button>
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="Bottom Right 提示文字" placement="bottom-end">
        <el-button>配置信息管理</el-button>
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="Bottom Right 提示文字" placement="bottom-end">
        <el-button>用户管理</el-button>
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="Bottom Right 提示文字" placement="bottom-end">
        <el-button>权限管理</el-button>
      </el-tooltip>
    </div>
  </div>
</template>

<script>
import { getList, del } from '@/api/merchant/merchant'
import store from '@/store'
import waves from '@/directive/waves' // 水波纹指令

export default {
  name: 'ComplexTable',
  directives: {
    waves
  },
  components: { },

  data() {
    return {
      tableKey: 0,
      list: null,
      total: null,
      listLoading: true,
      select_auditStatus: [],
      select_status: [],
      listQuery: {
        id: undefined,
        merchantName: undefined,
        adminAccount: undefined,
        adminPassword: undefined,
        paymentCode: undefined,
        auditStatus: undefined,
        status: undefined,
        phone: undefined,
        page: 1,
        limit: 20
      },
      formThead: {
        id: true,
        merchantName: true,
        adminAccount: true,
        adminPassword: true,
        paymentCode: true,
        auditStatus: true,
        status: true,
        phone: true
      }
    }
  },
  created() {
    this.getLists()
  },
  methods: {
    getLists() {
      this.listLoading = true
      getList(store.getters.token, this.listQuery).then(response => {
        this.list = response.data.list.data
        this.total = response.data.list.total
        this.listLoading = false
      })
    },
    handleFilter() {
      this.listQuery.page = 1
      this.getLists()
    },
    handleSizeChange(val) {
      this.listQuery.limit = val
      this.getLists()
    },
    handleCurrentChange(val) {
      this.listQuery.page = val
      this.getLists()
    },
    del(id) {
      this.$confirm('此操作将永久删除该商家信息, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message.info('正在删除，ID：' + id)
        del(store.getters.token, { id: id }).then(res => {
          if (res.status) {
            this.$message.success('已经删除，ID：' + id)
            this.getLists()
          } else {
            this.$message.error('删除失败，ID：' + id)
          }
        })
      }).catch(() => {
        this.$message.info('已取消删除，ID：' + id)
      })
    }
  }
}
</script>

